package com.social.controller;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.social.common.Result;
import com.social.dto.HouseKeeperDto;
import com.social.entity.*;
import com.social.service.certificate.CertificateService;
import com.social.service.emergencyContact.EmergencyContactService;
import com.social.service.houseKeeper.HouseKeeperService;
import com.social.service.houseKeeperMy.HouseKeeperMyService;
import com.social.service.trainExperience.TrainExperienceService;
import com.social.service.workexPerience.WorkexPerienceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.social.common.Tool.getIdByUUId;
import static com.social.common.Tool.isNotNull;
/*
* 我收藏的家政人员控制层
* */
@Controller
@RequestMapping(value = "/houseKeeperMy")
public class HouseKeeperMyController {
    @Autowired
    private HouseKeeperService houseKeeperService;
    @Autowired
    private HouseKeeperMyService houseKeeperMyService;
    @Autowired
    private WorkexPerienceService workexPerienceService;
    @Autowired
    private TrainExperienceService trainExperienceService;
    @Autowired
    private EmergencyContactService emergencyContactService;
    @Autowired
    private CertificateService certificateService;
    @RequestMapping(value = "/toAdd")
    public String houseKeeperAdd(){
        return "admin/houseKeeper-add";
    }
    @RequestMapping(value = "/toSearch")
    public String houseKeepertoSearch(){
        return "admin/houseKeeper-search";
    }
    @RequestMapping(value = "/toShow")
    public String houseKeepertoShow(String houseKeeperMyId, Model model,HttpSession session){
        Map<String,Object> params =new HashMap();
        AdminUser adminuser=(AdminUser)session.getAttribute("adminuser");
        params.put("adminUserId",adminuser.getId());
        params.put("houseKeeperMyId",houseKeeperMyId);
        HouseKeeperMy houseKeeperMy=houseKeeperMyService.selectByPrimaryKey(params);
        List<WorkexPerience> workexPerienceList = workexPerienceService.selectByHouseKeeperId(houseKeeperMyId);
        List<TrainExperience> trainExperienceList = trainExperienceService.selectByHouseKeeperId(houseKeeperMyId);
        List<Certificate> certificateList = certificateService.selectByHouseKeeperId(houseKeeperMyId);
        if(certificateList.size()<1){
            certificateList=null;
            model.addAttribute("card",0);
        }else{
            model.addAttribute("card",1);
        }
        model.addAttribute("certificateList",certificateList);
        model.addAttribute("trainExperienceList",trainExperienceList);
        model.addAttribute("workexPerienceList",workexPerienceList);
        model.addAttribute("houseKeeperId",houseKeeperMyId);
        model.addAttribute("datas",houseKeeperMy);
        model.addAttribute("isMy","my");
        return "admin/houseKeeper-show";
    }
    @ResponseBody
    @RequestMapping(value = "/show", produces = {"application/json;charset=UTF-8"})
    public String houseKeeperShow(String houseKeeperId,HttpSession session){
        JSONObject result = new JSONObject();
        Map<String,Object> params =new HashMap();
        AdminUser adminuser=(AdminUser)session.getAttribute("adminuser");
        params.put("adminUserId",adminuser.getId());
        params.put("houseKeeperMyId",houseKeeperId);
        HouseKeeperMy houseKeeperMy=houseKeeperMyService.selectByPrimaryKey(params);
        result.put("datas",houseKeeperMy);
        result.put("result", true);
        System.out.println("result=="+result.toJSONString());
        return result.toJSONString();
    }

    @ResponseBody
    @RequestMapping(value = "/add", produces = {"application/json;charset=UTF-8"})
    public String addHouseKeeper(HouseKeeperDto houseKeeperDto){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        JSONObject result = new JSONObject();
        HouseKeeper houseKeeper = new HouseKeeper();
        //获取UUID
        houseKeeper.setId(getIdByUUId());
        String houseKeeperId = houseKeeper.getId();
        //设置工作经验开始
        int workexPerienceCount = setWorkExperienceData(houseKeeperDto.getWorkexperiencedata(),houseKeeperId);
        result.put("workexPerienceCount", workexPerienceCount);
        //设置培训
        int trainExperienceCount=setTrainExperienceData(houseKeeperDto.getTrainexperiencedata(),houseKeeperId);
        result.put("trainExperienceCount", trainExperienceCount);
        //设置紧急联系人电话
        int emergencyContactDataCount=setEmergencyContactData(houseKeeperDto.getEmergencydata(),houseKeeperId);
        result.put("emergencyContactDataCount", emergencyContactDataCount);
        //设置证书
        int certificateDataCount=setCertificatedataData(houseKeeperDto.getCertificatedata(),houseKeeperId);
        result.put("certificateDataCount", certificateDataCount);

        System.out.println(" houseKeeper.getId()=="+ houseKeeperId);

        houseKeeper.setWorkpic(houseKeeperDto.getWorkpic());
        houseKeeper.setLifepic(houseKeeperDto.getLifepic());
        houseKeeper.setName(houseKeeperDto.getName());
        houseKeeper.setHeight(houseKeeperDto.getHeight());
        houseKeeper.setWeight(houseKeeperDto.getWeight());
        houseKeeper.setProfessional(formattingArry(houseKeeperDto.getProfessional()));
        houseKeeper.setPresentation(houseKeeperDto.getPresentation());
        houseKeeper.setPresentation2(houseKeeperDto.getPresentation2());
        houseKeeper.setHighgrade(houseKeeperDto.getHighgrade());
        houseKeeper.setExperience(houseKeeperDto.getExperience());
        houseKeeper.setSex(houseKeeperDto.getSex());
        try {
            String strings = houseKeeperDto.getBirthday();
            if(strings!=null&&strings!=""){

                houseKeeper.setBirthday(sdf.parse(strings));
            }

        } catch (ParseException e) {
            e.printStackTrace();
        }
        houseKeeper.setZodiac(houseKeeperDto.getZodiac());
        houseKeeper.setNativeplace(houseKeeperDto.getNativeplace());
        houseKeeper.setEducation(houseKeeperDto.getEducation());
        houseKeeper.setBoardandlodging(houseKeeperDto.getBoardandlodging());
        houseKeeper.setLanguage(formattingArry(houseKeeperDto.getLanguage()));
        houseKeeper.setCook(formattingArry(houseKeeperDto.getCook()));
        houseKeeper.setSkill(houseKeeperDto.getSkill());
        houseKeeper.setSkill2(houseKeeperDto.getSkill2());
        houseKeeper.setWorktype(houseKeeperDto.getWorktype());
        houseKeeper.setWorktime(houseKeeperDto.getWorktime());
        houseKeeper.setWorkstate(houseKeeperDto.getWorkstate());
        houseKeeper.setSalarystart(houseKeeperDto.getSalarystart());
        houseKeeper.setSalaryend(houseKeeperDto.getSalaryend());
        houseKeeper.setWorkarea(houseKeeperDto.getWorkarea());
        houseKeeper.setPhone1(houseKeeperDto.getPhone1());
        houseKeeper.setPhone2(houseKeeperDto.getPhone2());
        houseKeeper.setCertificate(formattingArry(houseKeeperDto.getCertificate()));
        houseKeeper.setIdcardnumber(houseKeeperDto.getIdcardnumber());
        houseKeeper.setIdcardpic(houseKeeperDto.getIdcardpic());
        houseKeeper.setJobnumber(houseKeeperDto.getJobnumber());
        houseKeeper.setCreatedate(new Date());
        int houseKeeperCount= houseKeeperService.addHouseKeeper(houseKeeper);

        if(houseKeeperCount>0){
            result.put("msg", "家政人员添加成功");
            result.put("code", "0");
            result.put("result", true);
        }else{
            result.put("msg", "家政人员添加失败");
            result.put("code", "1");
            result.put("result", false);
        }
        System.out.println("result=="+result.toJSONString());
        return result.toJSONString();
    }
    @ResponseBody
    @RequestMapping(value = "/update", produces = {"application/json;charset=UTF-8"})
    public String updateHouseKeeper(HouseKeeperDto houseKeeperDto){

        JSONObject result = new JSONObject();
        String houseKeeperId = houseKeeperDto.getHouseKeeperId();
        System.out.println("houseKeeperDto.getHouseKeeperid()=="+houseKeeperId);

        HouseKeeperMy houseKeeper=houseKeeperMyService.selectByPrimaryKeyString(houseKeeperId);

        //设置工作经验开始 先删除原来在添加新的
        int delWorkexPerienceCount = workexPerienceService.deleteByHouseKeeperId(houseKeeperId);
        int workexPerienceCount = setWorkExperienceData(houseKeeperDto.getWorkexperiencedata(),houseKeeperId);
        result.put("delWorkexPerienceCount", delWorkexPerienceCount);
        result.put("workexPerienceCount", workexPerienceCount);
        //设置培训 先删除原来在添加新的
        int delTrainExperienceCount = trainExperienceService.deleteByHouseKeeperId(houseKeeperId);
        int trainExperienceCount=setTrainExperienceData(houseKeeperDto.getTrainexperiencedata(),houseKeeperId);
        result.put("delTrainExperienceCount", delTrainExperienceCount);
        result.put("trainExperienceCount", trainExperienceCount);
        //设置紧急联系人电话 先删除原来在添加新的
        int delEmergencyContactDataCount = emergencyContactService.deleteByHouseKeeperId(houseKeeperId);
        int emergencyContactDataCount=setEmergencyContactData(houseKeeperDto.getEmergencydata(),houseKeeperId);
        result.put("delEmergencyContactDataCount", delEmergencyContactDataCount);
        result.put("emergencyContactDataCount", emergencyContactDataCount);


        //设置证书
        int delCertificateDataCount = certificateService.deleteByHouseKeeperId(houseKeeperId);
        int certificateDataCount=setCertificatedataData(houseKeeperDto.getCertificatedata(),houseKeeperId);
        result.put("certificateDataCount", certificateDataCount);
        result.put("delCertificateDataCount", delCertificateDataCount);

        houseKeeper.setWorkpic(houseKeeperDto.getWorkpic());
        houseKeeper.setLifepic(houseKeeperDto.getLifepic());
        houseKeeper.setName(houseKeeperDto.getName());
        houseKeeper.setHeight(houseKeeperDto.getHeight());
        houseKeeper.setWeight(houseKeeperDto.getWeight());
        houseKeeper.setProfessional(formattingArry(houseKeeperDto.getProfessional()));
        houseKeeper.setPresentation(houseKeeperDto.getPresentation());
        houseKeeper.setPresentation2(houseKeeperDto.getPresentation2());
        houseKeeper.setHighgrade(houseKeeperDto.getHighgrade());
        houseKeeper.setExperience(houseKeeperDto.getExperience());
        houseKeeper.setSex(houseKeeperDto.getSex());
        try {
            String strings = houseKeeperDto.getBirthday();
            if(strings!=null&&strings!=""){
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                houseKeeper.setBirthday(sdf.parse(strings));
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }
        houseKeeper.setZodiac(houseKeeperDto.getZodiac());
        houseKeeper.setNativeplace(houseKeeperDto.getNativeplace());
        houseKeeper.setEducation(houseKeeperDto.getEducation());
        houseKeeper.setBoardandlodging(houseKeeperDto.getBoardandlodging());
        houseKeeper.setLanguage(formattingArry(houseKeeperDto.getLanguage()));
        houseKeeper.setCook(formattingArry(houseKeeperDto.getCook()));
        houseKeeper.setSkill(houseKeeperDto.getSkill());
        houseKeeper.setSkill2(houseKeeperDto.getSkill2());
        houseKeeper.setWorktype(houseKeeperDto.getWorktype());
        houseKeeper.setWorktime(houseKeeperDto.getWorktime());
        houseKeeper.setWorkstate(houseKeeperDto.getWorkstate());
        houseKeeper.setSalarystart(houseKeeperDto.getSalarystart());
        houseKeeper.setSalaryend(houseKeeperDto.getSalaryend());
        houseKeeper.setWorkarea(houseKeeperDto.getWorkarea());
        houseKeeper.setPhone1(houseKeeperDto.getPhone1());
        houseKeeper.setPhone2(houseKeeperDto.getPhone2());
        houseKeeper.setCertificate(formattingArry(houseKeeperDto.getCertificate()));
        houseKeeper.setIdcardnumber(houseKeeperDto.getIdcardnumber());
        houseKeeper.setIdcardpic(houseKeeperDto.getIdcardpic());
        houseKeeper.setJobnumber(houseKeeperDto.getJobnumber());

        int res= houseKeeperMyService.updateByPrimaryKeySelective(houseKeeper);

        if(res>0){
            result.put("msg", "ok");
            result.put("code", "0");
            result.put("result", true);
        }else{
            result.put("msg", "not ok");
            result.put("code", "1");
            result.put("result", false);
        }
        result.put("res", res);
        System.out.println("result=="+result.toJSONString());
        return result.toJSONString();
    }
    @RequestMapping(value = "/index")
    public String welcome(){
        return "admin/houseKeeper-list";
    }
    @ResponseBody
    @RequestMapping(value = "/list", produces = "application/json;charset=UTF-8")
    public String getHouseKeeperList(HouseKeeperDto houseKeeperDto,HttpSession session){


        Map<String,Object> params =new HashMap();
        AdminUser adminuser=(AdminUser)session.getAttribute("adminuser");
        params.put("adminUserId",adminuser.getId());


        params=setSearchValue(params,houseKeeperDto);

        int currPage = (Integer) params.get("currPage");
        int pageSize = (Integer) params.get("pageSize");

        PageHelper.startPage(currPage, pageSize);
        List<HouseKeeperMy> houseKeeperMyList= houseKeeperMyService.getHouseKeeperMyList(params);
        Result result=new Result();
        result.setRows(houseKeeperMyList);
        PageInfo<HouseKeeperMy> pageInfo=new PageInfo<>(houseKeeperMyList);

        result.setTotal(pageInfo.getTotal());
        JSONObject result2 = new JSONObject();
        result2.put("msg", "ok");
        result2.put("result", true);
        result2.put("method", "getHouseKeeperList");
        result2.put("datas", houseKeeperMyList);
        result2.put("currPage", currPage);
        result2.put("pageSize",pageSize);
        result2.put("total",pageInfo.getTotal());

        System.out.println("result2=="+result2.toJSONString());
        return result2.toJSONString();
    }
    @RequestMapping(value = "/toEdit")
    public String toEdit(String houseKeeperId, Model model,HttpSession session){
        Map<String,Object> params =new HashMap();
        AdminUser adminuser=(AdminUser)session.getAttribute("adminuser");
        params.put("adminUserId",adminuser.getId());
        params.put("houseKeeperMyId",houseKeeperId);
        HouseKeeperMy houseKeeper=houseKeeperMyService.selectByPrimaryKey(params);
        List<EmergencyContact> emergencyContactList = emergencyContactService.selectByHouseKeeperId(houseKeeperId);
        List<TrainExperience> trainExperienceList = trainExperienceService.selectByHouseKeeperId(houseKeeperId);
        List<WorkexPerience> workexPerienceList = workexPerienceService.selectByHouseKeeperId(houseKeeperId);
        List<Certificate> certificateList = certificateService.selectByHouseKeeperId(houseKeeperId);
        model.addAttribute("datas",houseKeeper);
        model.addAttribute("emergencyContactList",emergencyContactList);
        model.addAttribute("trainExperienceList",trainExperienceList);
        model.addAttribute("workexPerienceList",workexPerienceList);
        model.addAttribute("certificateList",certificateList);
        model.addAttribute("isMy","my");

        return "admin/houseKeeper-edit";
    }

    //传入String[] 返回去掉'，'的字符串
    private String formattingArry(String[] pare){
        String str="";
        if(pare!=null&&pare.length>0){
            for(String p:pare){
                str=str+p+",";
            }
            str = str.substring(0,str.length() - 1);
        }
        return str;
    }
    //设置工作经验
    public int setWorkExperienceData(String workexperiencedata,String houseKeeperId){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        int workexPerienceCount=0;
        if(isNotNull(workexperiencedata)){
            //使用JSONArray
            JSONArray jsonarry = JSONArray.parseArray(workexperiencedata);

            for(int i =0;i<jsonarry.size();i++){
                WorkexPerience workexPerience=new WorkexPerience();
                workexPerience.setId(getIdByUUId());
                workexPerience.setHousekeeperid(houseKeeperId);
                workexPerience.setContent(jsonarry.getJSONObject(i).get("content").toString());
                try {
                    workexPerience.setWorktimestart(sdf.parse(jsonarry.getJSONObject(i).get("worktimestart").toString()));
                    workexPerience.setWorktimeend(sdf.parse(jsonarry.getJSONObject(i).get("worktimeend").toString()));
                } catch (ParseException e) {
                    e.printStackTrace();
                }
                int count=workexPerienceService.addWorkexPerience(workexPerience);
                if(count>0){
                    workexPerienceCount++;
                }
                System.out.println(" jsonarry.getJSONObject(i).get(\"name\")=="+ jsonarry.getJSONObject(i).get("content"));
            }
        }
        return workexPerienceCount;
    }
    //设置培训
    public int setTrainExperienceData(String trainexperiencedata,String houseKeeperId){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        int  trainPerienceCount=0;
        if(isNotNull(trainexperiencedata)){
            //使用JSONArray
            JSONArray jsonarry = JSONArray.parseArray(trainexperiencedata);

            for(int i =0;i<jsonarry.size();i++){
               TrainExperience trainExperience=new TrainExperience();
                trainExperience.setId(getIdByUUId());
                trainExperience.setHousekeeperid(houseKeeperId);

                try {
                    System.out.println(" jsonarry.getJSONObject(i).get(\"traintimeend\")=="+ jsonarry.getJSONObject(i).get("traintimeend"));
                    System.out.println(" jsonarry.getJSONObject(i).get(\"traintimestart\")=="+ jsonarry.getJSONObject(i).get("traintimestart"));
                    //开始时间
                    trainExperience.setTraintimestart(sdf.parse(jsonarry.getJSONObject(i).get("traintimestart").toString()));
                    //结束时间
                    trainExperience.setTraintimeend(sdf.parse(jsonarry.getJSONObject(i).get("traintimeend").toString()));


                } catch (ParseException e) {
                    e.printStackTrace();
                }
                //课程名称
                trainExperience.setCurriculumname(jsonarry.getJSONObject(i).get("curriculumname").toString());
                //机构名称
                trainExperience.setTraininginstitution(jsonarry.getJSONObject(i).get("traininginstitution").toString());
                //培训内容
                trainExperience.setContent(jsonarry.getJSONObject(i).get("traincontent").toString());
                //考评情况
                trainExperience.setCheckandevaluate(jsonarry.getJSONObject(i).get("checkandevaluate").toString());

                int count=trainExperienceService.addTrainExperience(trainExperience);
                if(count>0){
                    trainPerienceCount++;
                }
                System.out.println(" jsonarry.getJSONObject(i).get(\"name\")=="+ jsonarry.getJSONObject(i).get("content"));
            }
        }
        return trainPerienceCount;
    }
    //设置证书
    public int setCertificatedataData(String certificatedata,String houseKeeperId){
        int certificatedataCount=0;
        if(isNotNull(certificatedata)){
            //使用JSONArray
            JSONArray jsonarry = JSONArray.parseArray(certificatedata);

            for(int i =0;i<jsonarry.size();i++){
                Certificate certificate=new Certificate();
                certificate.setId(getIdByUUId());
                certificate.setHousekeeperid(houseKeeperId);
                certificate.setCertificatename(jsonarry.getJSONObject(i).get("certificatename").toString());
                certificate.setCertificatepic(jsonarry.getJSONObject(i).get("certificatepic").toString());
                int count=certificateService.addCertificate(certificate);
                if(count>0){
                    certificatedataCount++;
                }
            }
        }
        return certificatedataCount;
    }

    //设置紧急联系人
    public int setEmergencyContactData(String emergencycontactdata,String houseKeeperId){
        int emergencycontactdataCount=0;
        if(isNotNull(emergencycontactdata)){
            //使用JSONArray
            JSONArray jsonarry = JSONArray.parseArray(emergencycontactdata);

            for(int i =0;i<jsonarry.size();i++){
                EmergencyContact emergencyContact=new EmergencyContact();
                emergencyContact.setId(getIdByUUId());
                emergencyContact.setHousekeeperid(houseKeeperId);
                emergencyContact.setName(jsonarry.getJSONObject(i).get("emergencyname").toString());
                emergencyContact.setPhone(jsonarry.getJSONObject(i).get("emergencyphone").toString());
                int count=emergencyContactService.addEmergencyContact(emergencyContact);
                if(count>0){
                    emergencycontactdataCount++;
                }
            }
        }
        return emergencycontactdataCount;
    }
    //设置筛选参数
    public Map<String,Object>  setSearchValue(Map<String,Object> params,HouseKeeperDto houseKeeperDto){
        String keywords = houseKeeperDto.getKeywords();

        String classifyID = houseKeeperDto.getClassifyID();
        int currPage = houseKeeperDto.getCurrPage();
        int pageSize = houseKeeperDto.getPageSize();

        String orderby=houseKeeperDto.getOrderby();
        if(orderby!=null&&orderby!=""){
            params.put("orderby",orderby);
        }
        String collect=houseKeeperDto.getCollect();
        if(collect!=null&&collect!=""){
            params.put("collect",collect);
        }

        String professionalValue = houseKeeperDto.getProfessionalValue();
        if(professionalValue!=null&&professionalValue!=""){
            System.out.println("professionalValue=="+professionalValue);
            params.put("professionalValue",professionalValue.split(","));
        }
        String experienceValue = houseKeeperDto.getExperienceValue();
        if(experienceValue!=null&&experienceValue!=""){
            System.out.println("experienceValue=="+experienceValue);
            params.put("experienceValue",experienceValue.split(","));
        }
        String sexValue = houseKeeperDto.getSexValue();
        if(sexValue!=null&&sexValue!=""){
            System.out.println("sexValue=="+sexValue);
            params.put("sexValue",sexValue.split(","));
        }
        String agestartValue = houseKeeperDto.getAgestartValue();
        if(professionalValue!=null&&professionalValue!=""){
            System.out.println("agestartValue=="+agestartValue);
            params.put("agestartValue",agestartValue);
        }String ageendValue = houseKeeperDto.getAgeendValue();
        if(ageendValue!=null&&ageendValue!=""){
            System.out.println("ageendValue=="+ageendValue);
            params.put("ageendValue",ageendValue);
        }
        String zodiacValue = houseKeeperDto.getZodiacValue();
        if(zodiacValue!=null&&zodiacValue!=""){
            System.out.println("zodiacValue=="+zodiacValue);
            params.put("zodiacValue",zodiacValue.split(","));
        }
        String highgradeValue = houseKeeperDto.getHighgradeValue();
        if(highgradeValue!=null&&highgradeValue!=""){
            System.out.println("highgradeValue=="+highgradeValue);
            params.put("highgradeValue",highgradeValue.split(","));
        }
        String nativeplaceValue = houseKeeperDto.getNativeplaceValue();
        if(nativeplaceValue!=null&&nativeplaceValue!=""){
            System.out.println("nativeplaceValue=="+nativeplaceValue);
            params.put("nativeplaceValue",nativeplaceValue.split(","));
        }
        String educationValue = houseKeeperDto.getEducationValue();
        if(educationValue!=null&&educationValue!=""){
            System.out.println("educationValue=="+educationValue);
            params.put("educationValue",educationValue.split(","));
        }
        String boardandlodgingValue = houseKeeperDto.getBoardandlodgingValue();
        if(boardandlodgingValue!=null&&boardandlodgingValue!=""){
            System.out.println("boardandlodgingValue=="+boardandlodgingValue);
            params.put("boardandlodgingValue",boardandlodgingValue.split(","));
        }
        String languageValue = houseKeeperDto.getLanguageValue();
        if(languageValue!=null&&languageValue!=""){
            System.out.println("languageValue=="+languageValue);
            params.put("languageValue",languageValue.split(","));
        }
        String cookValue = houseKeeperDto.getCookValue();
        if(cookValue!=null&&cookValue!=""){
            System.out.println("cookValue=="+cookValue);
            params.put("cookValue",cookValue.split(","));
        }
        String worktypeValue = houseKeeperDto.getWorktypeValue();
        if(worktypeValue!=null&&worktypeValue!=""){
            System.out.println("worktypeValue=="+worktypeValue);
            params.put("worktypeValue",worktypeValue.split(","));
        }
        String worktimeValue = houseKeeperDto.getWorktimeValue();
        if(worktimeValue!=null&&worktimeValue!=""){
            System.out.println("worktimeValue=="+worktimeValue);
            params.put("worktimeValue",worktimeValue.split(","));
        }
        String workstateValue = houseKeeperDto.getWorkstateValue();
        if(workstateValue!=null&&workstateValue!=""){
            System.out.println("workstateValue=="+workstateValue);
            params.put("workstateValue",workstateValue.split(","));
        }
        String salaryValue = houseKeeperDto.getSalaryValue();
        if(salaryValue!=null&&salaryValue!=""){
            System.out.println("salaryValue=="+salaryValue);
            params.put("salaryValue",salaryValue);
        }
        String workareaValue = houseKeeperDto.getWorkareaValue();
        if(workareaValue!=null&&workareaValue!=""){
            System.out.println("workareaValue=="+workareaValue);
            params.put("workareaValue",workareaValue.split(","));
        }
        String certificateValue = houseKeeperDto.getCertificateValue();
        if(certificateValue!=null&&certificateValue!=""){
            System.out.println("certificateValue=="+certificateValue);
            params.put("certificateValue",certificateValue.split(","));
        }
        params.put("currPage",currPage);
        params.put("pageSize",pageSize);
        if(keywords!=null&&keywords!=""){
            params.put("keywords",keywords);
        }
        if(classifyID!=null&&classifyID!=""&&classifyID!="0"){
            params.put("type",classifyID);
        }

        return params;
    }


}
